import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_download_plugin/flutter_download_plugin.dart';
import 'package:flutter_download_plugin/flutter_download_plugin_platform_interface.dart';
import 'package:flutter_download_plugin/flutter_download_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterDownloadPluginPlatform
    with MockPlatformInterfaceMixin
    implements FlutterDownloadPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterDownloadPluginPlatform initialPlatform = FlutterDownloadPluginPlatform.instance;

  test('$MethodChannelFlutterDownloadPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterDownloadPlugin>());
  });

  test('getPlatformVersion', () async {
    FlutterDownloadPlugin flutterDownloadPlugin = FlutterDownloadPlugin();
    MockFlutterDownloadPluginPlatform fakePlatform = MockFlutterDownloadPluginPlatform();
    FlutterDownloadPluginPlatform.instance = fakePlatform;

    expect(await flutterDownloadPlugin.getPlatformVersion(), '42');
  });
}
